package com.java.cfpaying.feign;

import com.java.jwt.filter.utils.model.Jwt;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author cf
 * @date 2021/8/23 14:33
 */
@FeignClient(value = "user-server", fallback = Hystrix.class)
public interface FeignInterface {
    /**
     * 获取token
     *
     * @param grantType 授权类型
     * @param username  用户名
     * @param password  私钥
     * @return cn.hicloudnet.dc.dcims.jwt.model.Jwt
     * @author Wu Qingzhuang
     * @date 2021/08/17 11:32
     */
    @PostMapping(value = "/oauth/token")
    Jwt getToken(@RequestHeader(value = "Authorization") String authorization,
                 @RequestParam("grant_type") String grantType,
                 @RequestParam("username") String username,
                 @RequestParam("password") String password,
                 @RequestParam("scope") String scope);

}
